package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import com.itheima.pojo.dto.OrderSettingDTO;
import com.itheima.pojo.vo.OrderSettingVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Mapper
public interface OrderSettingMapper {

	@Select("select * from t_ordersetting where orderDate = #{orderDate}")
	OrderSetting getByOrederDate(LocalDate orderDate);

	@Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
	Integer editNumberByOrderDate(OrderSettingDTO orderSettingDTO);

	@Insert("insert into t_ordersetting(orderDate,number) values(#{orderDate},#{number})")
	Integer add(OrderSettingDTO orderSettingDTO);

	@Select("select * from t_ordersetting where orderDate between #{begin} and #{end}")
	List<OrderSetting> getOrderSettingByMonth(LocalDate begin, LocalDate end);
}
